Ejemplo n.º 1
0
        void Start()
        {
            Time.timeScale = 1f;
            return;

            var obj = GameObject.Instantiate <GameObject>(PrefabsMgr.Load("Prefabs/Game/Character"));

            obj.transform.position = Vector3.one;

            obj.SetActive(true);
            obj.layer = 20;
            foreach (var p in obj.GetComponentsInChildren <Collider>(true))
            {
                p.gameObject.layer = 20;
            }

            foreach (var p in obj.GetComponentsInChildren <LineRendererPositionModifier>())
            {
                p.SetColor(new Color(230f / 255f, 190f / 255f, 0f / 255f));
            }
            obj.GetComponentInChildren <PlayerHeadVisual>().SetColor(new Color(230f / 255f, 190f / 255f, 0f / 255f));
            var sync = obj.GetComponent <SyncablePlayer>();

            GameObject.DestroyObject(sync as Component);

            obj.GetComponent <PlayerRootScript>().SetHasControl();
            obj.GetComponent <PlayerInfo>().layer = 20;
            player = obj;
        }
Ejemplo n.º 2
0
        void Start()
        {
            Time.timeScale = 1f;
            return;

            var obj = GameObject.Instantiate <GameObject>(PrefabsMgr.Load("Prefabs/Game/Character"));

            obj.transform.position = Vector3.one;

            obj.SetActive(true);
            obj.layer = 20;
            foreach (var p in obj.GetComponentsInChildren <Collider>(true))
            {
                p.gameObject.layer = 20;
            }

            foreach (var p in obj.GetComponentsInChildren <SetLinePositions>())
            {
                p.SetColor(new Color(230f / 255f, 190f / 255f, 0f / 255f));
            }
            obj.GetComponentInChildren <HeadRenderer>().SetColor(new Color(230f / 255f, 190f / 255f, 0f / 255f));
            var sync = obj.GetComponent <SyncablePlayer>();

            GameObject.DestroyObject(sync as Component);

            obj.GetComponent <Controller>().TakeLocalControl();
            obj.GetComponent <CharacterInformation>().myLayer = 20;
            player = obj;
        }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
 }