示例#1
0
    // Push a new action to the action que
    public void AddActionToQue(TileAction action)
    {
        TileActionWalk walkAction = action as TileActionWalk;

        // If the new task is a walk task, cancel all previous tasks
        if (walkAction != null)
        {
            ClearActionQue();
            ResetAction();
        }
        actionQue.Add(action);
    }
示例#2
0
    // Walk to the partners tile and breform the breed action
    private IEnumerator DoWalkAndBreed(List <EnvironmentTile> route, EnvironmentTile tile, AnimalEntity partner)
    {
        yield return(TileActionWalk.DoGoTo(this, GetMovmentSpeed(), route));

        partner.ResetBreedingTimer();
        partner.breedHeartEffect.Play();
        breedHeartEffect.Play();

        // Create new animal
        {
            AnimalEntity ent = GameObject.Instantiate(this, Environment.instance.transform);

            Environment.instance.RegisterEntity(ent);

            ent.ResetBreedingTimer();
            ent.transform.position = tile.Position;
            ent.transform.rotation = Quaternion.identity;
            ent.CurrentPosition    = tile;
        }


        mPreformingAction = false;
    }
示例#3
0
    // Preform the walk action
    private IEnumerator DoWalk(List <EnvironmentTile> route, EnvironmentTile tile)
    {
        yield return(TileActionWalk.DoGoTo(this, GetMovmentSpeed(), route));

        mPreformingAction = false;
    }
示例#4
0
    // Preform the walk animation and move onto 'DoCollectionWithDelay'
    private IEnumerator DoWalkAndCollection(Entity entity, List <EnvironmentTile> route, EnvironmentTile tile)
    {
        yield return(TileActionWalk.DoGoTo(entity, entity.GetMovmentSpeed(), route));

        yield return(DoAction(entity, tile));
    }