Example #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>();
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        network         = GameObject.Find("NetworkManager").GetComponent <Network>();
        myCharacterName = PlayerPrefs.GetString("myCharacter");
        joy             = GameObject.Find("JoystickBackGround").GetComponent <JoyStick>();


        playerParams = GameObject.FindWithTag("Player").GetComponent <PlayerParams>();
        playerFSM2   = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>();

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

        characterCreate = GetComponent <CharacterCreate>();
        //greenRespawnTaiLung = GameObject.Find("GreenRespawnTaiLung").GetComponent<GameObject>();
        //redRespawnTiaLung = GameObject.Find("RedRespawnTaiLung").GetComponent<GameObject>();

        //greenRespawnCoundDown = GameObject.Find("GreenRespawnCoundDown").GetComponent<Text>();
        //redRespawnCoundDown = GameObject.Find("RedRespawnCoundDown").GetComponent<Text>();

        myBase       = characterCreate.myTeam;
        countDown    = 10f;
        respawnTimer = 0f;
    }
Example #3
0
    void Start()
    {
        player    = GameObject.FindWithTag("Player").GetComponent <PlayerParams>();
        playerFSM = GameObject.FindWithTag("RemotePlayer").GetComponent <PlayerFSM2>();

        remoteFSM    = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteFSM>();
        remotePlayer = GameObject.FindWithTag("RemotePlayer").GetComponent <PlayerParams>();
        InitParams();
    }
Example #4
0
        // Use this for initialization
        void Start()
        {
            //Splats = GameObject.Find("SplatManager").GetComponent<SplatManager>();
            myAni          = GameObject.FindWithTag("Player").GetComponent <PlayerAni>();
            playerFsm      = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>();
            playerAnimator = GameObject.FindWithTag("Player").GetComponent <Animator>();

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

            Timer = 0f;
        }
Example #5
0
    //public static void Main(string[] args)
    //{
    public void Start()
    {
        //androidPlugin = GameObject.Find("NetworkManager").GetComponent<AndroidPlugin>();


        Debug.Log("네트워크 스크립트");
        //joy = GameObject.Find("JoystickBackGround").GetComponent<JoyStick>();
        Debug.Log("네트워크 스크립트2");
        singleton = this;

        player    = GameObject.FindWithTag("Player").GetComponent <Transform>();
        playerAni = GameObject.FindWithTag("Player").GetComponent <PlayerAni>();

        player2   = GameObject.FindWithTag("RemotePlayer").GetComponent <Transform>();
        remoteAni = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteAni>();
        //rigidboby = GameObject.FindWithTag("RemotePlayer").GetComponent<Rigidbody>();

        //myId = androidPlugin.text;
        //myId = "Nova";
        //myTeam = "1";
        //myId = "Nova";

        //Debug.Log("내 아이디: "+ myId);

        //Connected();
        //Send(myId + "," + "myTeamCall");
        //ConnectToTcpServer();
        //clientSocket.Close();
        //myId = PlayerPrefs.GetString("myId");
        exampleClass = GameObject.Find("IDManager").GetComponent <ExampleClass>();
        myId         = exampleClass.myId;
        Debug.Log("Unity Network Script myId: " + myId);
        //Connected();
        //Send(myId);
        //ConnectToTcpServer();

        playerFsm  = GameObject.FindWithTag("RemotePlayer").GetComponent <PlayerFSM>();
        playerFsm2 = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>();

        remoteFSM = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteFSM>();

        monsterFSM = GameObject.Find("Spider").GetComponent <MonsterFSM>();


        Connected();
        Send(myId);
        ConnectToTcpServer();

        skillOne = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>();
        //StartCoroutine(PlayerSet());
    }
Example #6
0
    void CallDeadEvent()
    {
        Debug.Log("포탑이 파괴 되었습니다.");

        //DistroyRedTower = Resources.Load("huo_ju_002") as GameObject;
        //Vector3 pos = redTowerTransform.transform.position;
        //redTowerRotation.eulerAngles = new Vector3(0, 100, 0);
        //DistroyRedTower.transform.rotation = redTowerRotation;

        //Instantiate(DistroyRedTower, pos, DistroyRedTower.transform.rotation).name = "redTowerDistroy";
        ShowHitEffect();
        //redTower.SetActive(false);

        DistroyRedTower.SetActive(true);
        if (playerFSM2 == null)
        {
            playerFSM2 = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>();
        }
        playerFSM2.gameObject.SendMessage("redTowerDead");
        remoteFSM.gameObject.SendMessage("redTowerDead");
        // 타워 파괴 애니메이션을 발동
    }
Example #7
0
    private void Update()
    {
        if (playerFsm2 == null)
        {
            playerFsm2 = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>();
            Debug.Log("JoyStick Script playerFsm2 가 Null PointException : PlayerFSN2 를 다시 지정해줌  ");
        }

        if (MoveFlag)
        {
            Player.transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed);
        }


        //if (remoteMoveFlag && stop == false)
        //{
        //    Debug.Log("Network Script void Update if MoveFlag Log ");
        //    player2.eulerAngles = new Vector3(0, Mathf.Atan2(JoyVec.x, JoyVec.y) * Mathf.Rad2Deg, 0);
        //    Debug.Log("Network Script void Update if MoveFlag Log 1");
        //    player2.transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed);
        //    Debug.Log("Network Script void Update if MoveFlag Log 2");

        //    remoteAni.ChangeAni(RemoteAni.ANI_WALK);
        //    Debug.Log("Network Script void Update if MoveFlag Log 3");
        //    stop = true;
        //}

        //else if (remoteMoveFlag == false && stop == true)
        //{
        //    remoteAni.ChangeAni(RemoteAni.ANI_IDLE);

        //    stop = false;
        //}

        //if (attackFlag.Equals("remotePlayer") && attackControl == true)
        //{
        //    playerFsm2.ChangeState(PlayerFSM2.State.Chase, PlayerAni.ANI_WALK);
        //    attackControl = false;
        //    attackFlag = "";
        //}
        //else if (attackFlag.Equals("redTower"))
        //{
        //    playerFsm2.ChangeState(PlayerFSM2.State.Chase, PlayerAni.ANI_WALK);
        //    attackControl = false;
        //    attackFlag = "";
        //    Debug.Log("네트워크 스크립트 상태 체인지 > 추적");
        //}


        //playerMove = Player.transform.position.ToString();
        //playerMove = playerMove.Substring(1, playerMove.Length - 2);

        //Debug.Log(playerMove);



        //  anim.Play("1_walk");
        //if (anim.GetBool("Move"))
        //{
        //    anim.Play("1_walk");

        //}
    }