예제 #1
0
 private void Update()
 {
     if (skillData.isOnReady() && Input.GetMouseButton(MouseClick[LeftClick]))
     {
         skillData.activateSkill();
         playerWeapon.setWeaponDisabled(true);
         solarShieldOnActive = Instantiate(solarShield, transform.position, Quaternion.identity).GetComponent <Player_Skill_SolarShieldObject>();
         isShieldOnActive    = true;
     }
 }
예제 #2
0
 private void Start()
 {
     enemyWeapon = GetComponent <Common_WeaponObject>();
     if (enemyWeapon != null)
     {
         enemyWeapon.setWeaponDisabled(true);
     }
 }
예제 #3
0
    private void FixedUpdate()
    {
        switch (state)
        {
        case RouteState.onMove:
            if (transform.position != enemyRoute.routeList[curRouteIndex].destination)
            {
                transform.position = Vector3.MoveTowards(
                    transform.position,
                    enemyRoute.routeList[curRouteIndex].destination,
                    enemyRoute.routeList[curRouteIndex].linearVelocity * Time.fixedDeltaTime);
            }
            else if (enemyWeapon != null && enemyRoute.routeList[curRouteIndex].isFireOnWait)
            {
                if (enemyRoute.routeList[curRouteIndex].isWeaponRefresh)
                {
                    enemyWeapon.initializeWeapons();
                }
                enemyWeapon.setWeaponDisabled(!enemyRoute.routeList[curRouteIndex].isFireOnWait);
                state = RouteState.onFire;
            }
            else if (enemyRoute.routeList[curRouteIndex].waitTime >= 0.02f)
            {
                setToWait();
            }
            else
            {
                setToNext();
            }
            break;

        case RouteState.onFire:
            if (enemyWeapon.getCurWeaponData().isOnEnd())
            {
                enemyWeapon.setWeaponDisabled(true);
                setToWait();
            }
            break;

        case RouteState.onWait:
            if (!enemyRoute.routeList[curRouteIndex].isWaitTimeOut())
            {
                enemyRoute.routeList[curRouteIndex].countWaitTime(Time.fixedDeltaTime);
            }
            else
            {
                setToNext();
            }
            break;

        case RouteState.onStart:
            curRouteIndex = 0;
            setToMove();
            break;

        case RouteState.onEnd:
            if (isDestroyOnEnd)
            {
                Destroy(gameObject);
            }
            else if (isFireOnEnd)
            {
                if (enemyWeapon != null)
                {
                    if (isWeaponRefreshOnEnd)
                    {
                        enemyWeapon.initializeWeapons();
                    }
                    enemyWeapon.setWeaponDisabled(false);
                }
            }
            break;
        }
    }