/// <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); }
/// <summary> /// HealthManagerをアタッチする。 /// </summary> void AttachBoostManager() { var playerList = GameObject.FindGameObjectsWithTag("Player"); foreach(var player in playerList) { if (player.GetComponent<NetworkView>().isMine) { boostManager = player.GetComponent<BoostManager>(); } } }
void Initialize() { var player = GameObject.FindGameObjectWithTag("Player"); if (player == null) return; boostManager = player.GetComponent<BoostManager>(); parentRect = transform.parent.GetComponent<RectTransform>(); myRect = GetComponent<RectTransform>(); }
private void CreateSingleton() { if (Instance == null) { Instance = this; //DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
/// <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); }
// Use this for initialization void Start() { rigidBody = GetComponent<Rigidbody>(); boostManager = GetComponent<BoostManager>(); }
void Awake () { skillManager = this; boostManager = transform.FindChild ("BoostManager").GetComponent<BoostManager> (); skillsEnabled = new List<SkillItem> (); }
public BoostArea(Boost[] listOfBoosts,float _timeBoost, BoostManager _manager, GameObject _follow) : base(listOfBoosts,_timeBoost,_manager) { follow = _follow; pos = follow.transform.position; }
public BoostArea(Boost[] listOfBoosts,float _timeBoost, BoostManager _manager, Vector3 _pos) : base(listOfBoosts,_timeBoost,_manager) { pos = _pos; }