/// <summary> /// Добавить исполнител на площадку /// </summary> /// <param name="actor">GameObject префаба</param> public void InstanceActor(GameObject actor, Vector3 pos) { ActorCommandButton actorCommandButton = Instantiate(actor, pos, Quaternion.Euler(0, 0, 180)).GetComponent <ActorCommandButton>(); SubscribingToAnEvent(actorCommandButton); actorCommandButton.ButtonCliccked += menuController.AllToDefaultExcludeThis; actorCommandButton.ObjectDeleted += UnsubscribingToAnEvent; ReturnToDefaultState(); }
/// <summary> /// Добавить исполнител на площадку /// </summary> /// <param name="actor">GameObject префаба</param> private void InstanceActor(string holder, InstanceType type) { ActorCommandButton actorCommandButton = Instantiate(instancePrefabs[(int)(type)], Vector3.zero, Quaternion.Euler(0, 0, 180)).GetComponent <ActorCommandButton>(); SubscribingToAnEvent(actorCommandButton); actorCommandButton.ButtonCliccked += menuController.AllToDefaultExcludeThis; actorCommandButton.ObjectDeleted += UnsubscribingToAnEvent; ReturnToDefaultState(); actorCommandButton.SetOptions(holder); }