Exemplo n.º 1
0
 public CDistroyer()
 {
     Type       = EUnitType.Distroyer;
     Speed      = 40;
     myBehavior = new CSeaBehavior();
     myWeapon   = new CCannon();
 }
Exemplo n.º 2
0
	protected int 		m_nIdx 							= 0;			//< This cannon index in the cannon list

	/* -----------------------------------------------------------------------------------------------------------
	 * UNITY'S STUFF HERE
	 * -----------------------------------------------------------------------------------------------------------
	 */

	/// <summary>
	/// Will execute when loaded
	/// </summary>
	void Awake() {

		Script = this;

		// Get the main script
		mainScript = GameObject.Find("/GameCode").GetComponent<ShooterControl>();

		if(!mainScript) {

			// DEBUG
			Debug.LogError(this.transform + " could get the ShooterControl from Code");
		}

		RegisterMyselfWithMainScript();
	}
Exemplo n.º 3
0
    /// <summary>
    /// Add a cannon to the cannon list
    /// </summary>
    /// <param name="tr"> The transform for the new cannon </param>
    public void RegisterCannon(Transform tr, CCannon script)
    {
        int nCount = lCannons.Count;

        lCannons.Add(tr);
        lCannonsScripts.Add(script);

        script.nIdx = nCount;

        // FIXME: hack to make the player control a cannon
        if (nPlayerCannonIdx < 0)
        {
            PlayerControlCannon(trPlayer, nCount);
        }
    }