예제 #1
0
    public void Initialize()
    {
        gameManager = FindObjectOfType <GameManager>();
        wpmanager   = FindObjectOfType <WPManager>();

        InstanceObstacle();
        rotator = obstacle.GetComponent <DoorRotator>();
    }
예제 #2
0
 public void InitializeWPManager()
 {
     wpmanager = FindObjectOfType <WPManager>();
     if (wpmanager != null)
     {
         wpmanager.Initialize();
     }
     else
     {
         Debug.Log("WPManager is lost");
     }
 }
예제 #3
0
    public override void Initialize()
    {
        base.Initialize();
        startNode = board.FindNodeAt(transform.position);
        if (startNode == null)
        {
            Debug.LogWarning($"{gameObject.name} start node is lost");
        }

        startRotation = transform.rotation;
        wpmanager     = FindObjectOfType <WPManager>();
        sensor        = GetComponent <EnemySensor>();
        GetComponent <EnemyManager>().DeathEvent.AddListener(() => currentNode = null);
    }
예제 #4
0
        private void AddPortlet(int portletId, string zoneId)
        {
            var portlet  = Node.LoadNode(portletId);
            var typeName = portlet["TypeName"].ToString();
            var wpz      = WPManager.Zones[zoneId];

            if (wpz == null)
            {
                return;
            }

            var    privateType = Type.GetType(typeName);
            object instance    = null;

            try
            {
                instance = Activator.CreateInstance(privateType);
            }
            catch (Exception e)
            {
                SnLog.WriteException(e);
            }
            var wp = (WebPart)instance;

            if (wp != null)
            {
                WPManager.AddWebPart(wp, wpz, 0);
            }

            var mode = WPManager.SupportedDisplayModes["Edit"];

            if (mode != null)
            {
                WPManager.DisplayMode = mode;
                InitializeControl();
            }

            var snwpm = this.WPManager as SNWebPartManager;

            if (snwpm != null)
            {
                snwpm.SetDirty();
            }
        }