Пример #1
0
    public override void setBehaviourParams()
    {
        BehaviorExecutor behaviorExecutor = GetComponent <BehaviorExecutor>();
        GameManager      gManager         = sirLasagna.GetComponent <GameManager>();

        behaviorExecutor.SetBehaviorParam("gameObject", gameObject);
        behaviorExecutor.SetBehaviorParam("homePosition", transform.position);
        behaviorExecutor.SetBehaviorParam("player", gManager.player.gameObject);
    }
    void Start()
    {
        GameObject       instance         = Instantiate(prefab, position, Quaternion.identity) as GameObject;
        BehaviorExecutor behaviorExecutor = instance.GetComponent <BehaviorExecutor>();

        if (behaviorExecutor != null)
        {
            behaviorExecutor.SetBehaviorParam("wanderArea", wanderArea);
            behaviorExecutor.SetBehaviorParam("player", player);
        }
    }
Пример #3
0
    void Spawn()
    {
        if (spawnCount <= Spawns)
        {
            GameObject       instance  = Instantiate(prefab, GetRandomPosition(), Quaternion.identity) as GameObject;
            BehaviorExecutor component = instance.GetComponent <BehaviorExecutor>();
            component.SetBehaviorParam("wanderArea", wanderArea);
            component.SetBehaviorParam("player", entities[Random.Range(0, entities.Count)]);

            ++spawnCount;

            entities.Add(instance);
        }
        else
        {
            CancelInvoke();
        }
    }
Пример #4
0
    //public Text text;

    /// <summary>
    /// method that instantiates the gameobjet in a certain position and adds the BehaviorExcutor component to follow the player
    /// </summary>
    void Start()
    {
        GameObject       instance         = Instantiate(prefab, position, Quaternion.identity) as GameObject;
        BehaviorExecutor behaviorExecutor = instance.GetComponent <BehaviorExecutor>();


        //Codigo comentado para comprobaciones de editor y runtime

        //if (BBUnity.Managers.BBManager.Instance.IsEditor)
        //    text.text = "EDITOR";
        //else
        //    text.text = "RUNTIME";

        if (behaviorExecutor != null)
        {
            behaviorExecutor.SetBehaviorParam("wanderArea", wanderArea);
            behaviorExecutor.SetBehaviorParam("player", player);
        }
    }