Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can i set up script "templates" with unity ?

Discussion in 'Scripting' started by Sylvir, Jul 22, 2016.

  1. Sylvir

    Sylvir

    Joined:
    Mar 21, 2015
    Posts:
    396
    I am just wondering if there was a way to save a few different templates that I use commonly with unity and scripting? Things such as the base singleton pattern and stuff like that so that i can just hit load an open up my new script with that base outline all ready set up? Not sure if this is possible its not really a major thing just would be nice and save a bit of time when working on projects in the future. Thanks :)
     
  2. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    you can implement interface scripts that has standardized how you do your projects.
     
  3. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
  4. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Export your custom script templates in a package, then import them into your projects. (When you change the name of a script, you can import the same template again without previous imports being overwritten). For the most common template, use the method by Gambit-M Splitz.
     
  5. Sylvir

    Sylvir

    Joined:
    Mar 21, 2015
    Posts:
    396
    awesome, sounds great thanks for the tips everyone! sounds like this is something that other people have wanted to implement as well and it sounds like there are a few different ways to do so :) appreciate the feedback everyone and happy developing :)