示例#1
0
    void Start()
    {
        skillButton = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>();

        Player = GameObject.FindWithTag("Player").GetComponent <Transform>();
        anim   = GameObject.FindWithTag("Player").GetComponent <Animator>();

        player2    = GameObject.FindWithTag("RemotePlayer").GetComponent <Transform>();
        playerFsm2 = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>();
        attack     = GameObject.Find("AttackButton").GetComponent <AttakButton>();
        myAni      = GameObject.FindWithTag("Player").GetComponent <PlayerAni>();

        characterCreate = new CharacterCreate();
        gameManager     = GameObject.Find("GameManager").GetComponent <GameManager>();


        //Player = GameObject.Find(myid).GetComponent<Transform>();
        Debug.Log("JoyStick Scripts myid value: " + myid);
        // Player = GameObject.FindWithTag("Player").GetComponent<Transform>();
        //EventTrigger eventTrigger = new EventTrigger();
        Radius        = GetComponent <RectTransform>().sizeDelta.y * 0.5f;
        StickFirstPos = Stick.transform.position;

        // 캔버스 크기에대한 반지름 조절.
        float Can = transform.parent.GetComponent <RectTransform>().localScale.x;

        Radius *= Can;

        MoveFlag = false;

        network = GameObject.Find("NetworkManager").GetComponent <Network>();
        myid    = network.myId;
        Debug.Log("네트워크 스크립트 내 아이디  : " + network.myId);
        remoteAni = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteAni>();
    }
示例#2
0
    // 초기화
    void Start()
    {
        playerCharacter = GameObject.FindWithTag("Player");

        player   = GameObject.FindWithTag("Player").transform;
        myParams = GetComponent <PlayerParams>();
        myAni    = GetComponent <PlayerAni>();
        myParams.InitParams();
        myParams.deadEvent.AddListener(ChangeToPlayerDead);

        remotePlayer = GameObject.FindWithTag("RemotePlayer").transform;
        remoteParams = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteParams>();
        remoteAni    = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteAni>();
        remoteFSM    = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteFSM>();

        monster     = GameObject.Find("Spider").transform;
        skillButton = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>();

        curEnemyParams = GameObject.Find("Monster").GetComponent <MonsterParams>();


        basicAttack = GameObject.Find("AttackButton").GetComponent <AttakButton>();

        redTowerPos = GameObject.FindWithTag("RedTower").transform;

        towerParams = GameObject.FindWithTag("RedTower").GetComponent <TowerParams>();

        network = GameObject.Find("NetworkManager").GetComponent <Network>();


        joy = GameObject.Find("JoystickBackGround").GetComponent <JoyStick>();
    }