Пример #1
0
 void OnEnable()
 {
     OnNewInteractiveBloc = PubsubHandler.HandleNewInteractiveBloc((GameObject bloc) =>
     {
         print("MyEventSystem::HandleNewInteractiveBloc -- Save new bloc " + bloc);
         this.bloc = bloc.GetComponent <InteractiveBloc>();
     });
 }
Пример #2
0
    void AddBloc(InteractiveBloc bloc)
    {
        tblocs.Add(bloc);
        bloc.transform.SetParent(transform);
        bloc.tag = "Tower";
        bloc.GetComponent <Rigidbody>().Sleep();
        // bloc.GetComponent<Rigidbody>().mass = 1000;

        Pubsub.Publish(Pubsub.Type.NewBlocOnTower, new object[] { tblocs.Count, bloc.gameObject });
    }