Ejemplo n.º 1
1
	/// <summary>
	/// Constructor basico sin lista de unidades a las que afecta <see cref="BoostItem"/> class.
	/// </summary>
	/// <param name="listOfBoosts">Lista de mejoras a las que llama.</param>
	/// <param name="_timeBoost">Tiempo de duracion de las mejoras.</param>
	/// <param name="_manager">Gestor de las mejoras</param>
	public BoostItem(Boost[] listOfBoosts,float _timeBoost, BoostManager _manager){
		units = null;
		boosts = listOfBoosts;
		timeBoost = _timeBoost;
		manager = _manager;
		active = true;
	//	Invoke("RemoveBoost",timeBoost);
	}
Ejemplo n.º 2
0
 /// <summary>
 /// HealthManagerをアタッチする。
 /// </summary>
 void AttachBoostManager()
 {
     var playerList = GameObject.FindGameObjectsWithTag("Player");
     foreach(var player in playerList)
     {
         if (player.GetComponent<NetworkView>().isMine)
         {
             boostManager = player.GetComponent<BoostManager>();
         }
     }
 }
Ejemplo n.º 3
0
    void Initialize()
    {
        var player = GameObject.FindGameObjectWithTag("Player");
        if (player == null) return;

        boostManager = player.GetComponent<BoostManager>();

        parentRect = transform.parent.GetComponent<RectTransform>();

        myRect = GetComponent<RectTransform>();
    }
Ejemplo n.º 4
0
 private void CreateSingleton()
 {
     if (Instance == null)
     {
         Instance = this;
         //DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 5
0
	/// <summary>
	/// Initializes a new instance of the <see cref="BoostItem"/> class.
	/// </summary>
	/// <param name="listOfBoosts">Lista de mejoras a las que llama.</param>
	/// <param name="_timeBoost">Tiempo de duracion de las mejoras.</param>
	/// <param name="_units">Unidades a las que afecta</param>
	/// <param name="_manager">Gestor de las mejoras.</param>
	public BoostItem(Boost[] listOfBoosts,float _timeBoost, List<Unit> _units, BoostManager _manager){
		boosts = listOfBoosts;
		timeBoost = _timeBoost;
		units = _units;
		manager = _manager;
		active = true;
		for (int i=0; units != null && i < units.Count; i++){
			foreach(Boost boost in boosts)
				boost.Apply(units[i]);
		}
//		Invoke("RemoveBoost",timeBoost);
	}
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     rigidBody = GetComponent<Rigidbody>();
     boostManager = GetComponent<BoostManager>();
 }
Ejemplo n.º 7
0
	void Awake () {
		skillManager = this;
		boostManager = transform.FindChild ("BoostManager").GetComponent<BoostManager> ();
		skillsEnabled = new List<SkillItem> ();
	}
Ejemplo n.º 8
0
	public BoostArea(Boost[] listOfBoosts,float _timeBoost, BoostManager _manager, GameObject _follow) 
		: base(listOfBoosts,_timeBoost,_manager)
	{
		follow = _follow;
		pos = follow.transform.position;
	}
Ejemplo n.º 9
0
	public BoostArea(Boost[] listOfBoosts,float _timeBoost, BoostManager _manager, Vector3 _pos) 
		: base(listOfBoosts,_timeBoost,_manager)
	{
		pos = _pos;
	}