Class with monkey's definitions
상속: CBaseEntity
예제 #1
0
    /// <summary>
    /// Receive a delivered prisoner
    /// </summary>
    public void ReceivePrisoner(CMonkey monkeyPrisoner)
    {
        // FIXME: we're assuming that a command center will be the prison...
        if(!this.controlSpot) {

            // DEBUG
            Debug.LogError(this.transform + " can't find the ControlSpot for this building, so I can't transfer the	prisoner");
        }

        monkeyPrisoner.CapturedBy(this.transform, this.controlSpot, null);
        this.capturedEntity = monkeyPrisoner;

        // Check for game over conditions
        mainScript.CheckIfAllMonkeysAreConvicts();
    }
예제 #2
0
 public void addMonkey(CMonkey newMonkey)
 {
     if (allMonkeys == null)
         allMonkeys = new ArrayList();
     allMonkeys.Add(newMonkey);
     if (boxYposition == null)
         boxYposition = new ArrayList();
     boxYposition.Add(642);
     if (yDirection == null)
         yDirection = new ArrayList();
     yDirection.Add(0);
 }
예제 #3
0
    /// <summary>
    /// Put one of the monkey inside the rocket
    /// </summary>
    public void PutAMonkeyInsideRocket(Transform tMonkey, CMonkey.eMonkeyType eMonkeyClass)
    {
        // FIXME: actually we need a list of monkeys here, or else the GetTheMonkeyOut() will only release
        // the last monkey who entered
        monkeyInside = tMonkey;

        // Add the boarded monkey to the list
        mainScript.lBoardedMonkeys.Add(tMonkey);

        tMonkey.gameObject.GetComponent<CBaseEntity>().Deselect();
        tMonkey.gameObject.GetComponent<CBaseEntity>().Selectable = false;

        if(sfxLoadMonkey)
            AudioSource.PlayClipAtPoint(sfxLoadMonkey, transform.position);

        monkeyInside.transform.position = controlSpot.transform.position;

        // Check if we haven't boarded all monkeys. If so, the game was won!
        mainScript.CheckIfAllMonkeysAreBoarded();
    }