Ejemplo n.º 1
0
 public static FriendlyFactory GetInstance()
 {
     if (instance == null)
     {
         instance = new FriendlyFactory();
     }
     return(instance);
 }
Ejemplo n.º 2
0
    void Awake()
    {
        enemy1 = EnemyFactory.getEnemy(EnemyTypes.flying);
        enemy1 = EnemyFactory.getEnemy(EnemyTypes.walking);

        friendly1 = FriendlyFactory.getFriendly(FriendlyTypes.flying);
        friendly2 = FriendlyFactory.getFriendly(FriendlyTypes.walking);
    }
    /*
     * GameObject
     */
    private void Awake()
    {
        int seed = Mathf.CeilToInt(Random.Range(0, 3));

        switch (seed)
        {
        case 0:
            Feature = CharismaticFactory.GetInstance().GetCharismaticFeature();
            break;

        case 1:
            Feature = FriendlyFactory.GetInstance().GetFriendlyFeature();
            break;

        case 2:
            Feature = ShyFactory.GetInstance().GetShyFeature();
            break;

        default:
            break;
        }
    }