Ejemplo n.º 1
0
    void Awake()
    {
        if (m_Instance != null)
        {
            Debug.LogError("Player already exists.");
        }

        m_Instance = this;

        this.m_MeshFilter = this.GetComponent <MeshFilter>();

        m_VertexMat = this.GetComponent <Renderer>().material;

        m_FrameTime = 1.0f / m_FramesPerSecond;

        m_PlayerAnimControl = this.GetComponent <PlayerAnimControl>();

        //init particlePool
        m_ParticleRoot      = new GameObject().transform;
        m_ParticleRoot.name = "RunParticleRoot";

        for (int i = 0; i < c_NumRunParticles; i++)
        {
            var go = GameObject.Instantiate(m_RunParticlePrefab);
            go.transform.SetParent(m_ParticleRoot);
            go.SetActive(false);
            m_ParticlePool.Add(go);
        }

        this.m_CharacterController = this.GetComponent <CharacterController>();
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        rb   = GetComponent <Rigidbody2D>();
        anim = GetComponent <PlayerAnimControl>();
        //jetpack_particles.Stop();

        jetpack_cooldown_timer = jetpack_cooldown;
    }
Ejemplo n.º 3
0
            static void StartPost(PlayerAnimControl __instance)
            {
                var userInfoWindow = __instance.gameObject.GetComponent <WingUserInfoWindow>();

                if (userInfoWindow == null)
                {
                    userInfoWindow = __instance.gameObject.AddComponent(typeof(WingUserInfoWindow)) as WingUserInfoWindow;
                }
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets initial variables and components
 /// </summary>
 void Start()
 {
     // set component to attributes script
     gm  = GameObject.FindWithTag("Manager").GetComponent <GameManager>();
     im  = GameObject.FindWithTag("Manager").GetComponent <InputManager>();
     es  = GameObject.FindGameObjectWithTag("Manager").GetComponent <EnemySpawner>();
     pac = GetComponent <PlayerAnimControl>();
     //anim = GetComponent<Animator>();
     // disable the swipe renderer and set animation speed
     //swipeRend.enabled = false;
     pac.Speed = 2;
     pac.SetState(1, false, false, true, false);
     //anim.speed = 5;
 }
Ejemplo n.º 5
0
    void Start()                                                                                          ////////////////////////    셋업      //////////////////////////
    {
        _WM_            = GameObject.FindGameObjectWithTag("GM").GetComponent <MasterWeaponManagement>(); //  마스터 무기 매니저 스크립트
        anim            = GetComponent <Animator>();                                                      // 플레이어 애니메이터
        ac              = GetComponent <PlayerAnimControl>();                                             // 플레이어 애니메이션 매니저 스크립트
        pm              = GetComponent <PlayerMove>();
        activeGunFolder = gunFolder_Default;
        //defaultWeapon.GetComponent<WeaponStats>().PickUp(transform);

        //  무기 수 제한
        while (weapons.Count > maxWeaponCount)
        {
            weapons[weapons.Count - 1].GetComponent <WeaponStats>().Drop();
            weapons.Remove(weapons[weapons.Count - 1]);
        }
        // 총이 없을 때
        if (activeWeapon == null)
        {
            SetCategoryAnimWeight(anim.GetLayerIndex("Default [Type-0]"), false);
        }
    }
Ejemplo n.º 6
0
            static void UpdatePre(PlayerAnimControl __instance, float ___shootCoolDownTimer)
            {
                var pa = PlayerAnimControl.instance;

                //自动剑返
                if (mod.Active && settings.FlySwardAutoBack &&
                    // 剑神
                    ((!pa.SWORDMASTER_SKILL_UnlimitedSwords && pa.playerParameter.SWORDS_COUNT == 0) ||
                     (pa.SWORDMASTER_SKILL_UnlimitedSwords &&
                      (pa.SWORDMASTER_SKILL_UnlimitedSwords_IsOverHeat ||
                       pa.SWORDMASTER_SKILL_UnlimitedSwords_Heat >= pa.SWORDMASTER_SKILL_UnlimitedSwords_MaxHeat))
                    ) &&
                    // 贯日
                    (!pa.SWORDMASTER_SKILL_GUANRI ||
                     (pa.SWORDMASTER_SKILL_GUANRI && !pa.SWORDMASTER_SKILL_GUANRI_UnlimitedState && !pa.SWORDMASTER_SKILL_GodOfSwords_IsGodState)) &&
                    IsFlySwardBackCdOk() &&
                    (CheckPlayerInputDown(SpecialAction.FlyingSword) || CheckPlayerInputKeep(SpecialAction.FlyingSword)))
                {
                    PlayerAnimControl.instance.ShouldDrawSword = true;
                    // 冷却时间
                    PlayerAnimControl.instance.DrawCoolDownTimer = 0;
                }
            }
Ejemplo n.º 7
0
 void Start()
 {
     control = GetComponent <PlayerAnimControl>();
 }