コード例 #1
0
ファイル: GameManager.cs プロジェクト: yamato-hgf/CatJump
    IEnumerator CreateStage(StageData stageData)
    {
        _initialized = false;
        _boss        = Instantiate <EnemyBoss>(_prefabEnemyBosses [stageData.StageNo]);
        _boss.transform.localPosition = stageData.BossPos;
        _boss.transform.SetParent(_gameUnitWorld.transform, false);

        foreach (StageDataObject stageDataObject in stageData.Objects)
        {
            StageObject prefab = null;
            switch (stageDataObject.Type)
            {
            case StageDataObject.DataType.Scaffold:
                prefab = _prefabObjectScaffolds[stageDataObject.Size];
                break;

            case StageDataObject.DataType.Block:
                prefab = _prefabObjectBlocks[stageDataObject.Size];
                break;
            }
            if (prefab != null)
            {
                StageObject stageObject = Instantiate <StageObject> (prefab);
                stageObject.Setup(stageDataObject);
                stageObject.transform.SetParent(_gameUnitWorld.transform, false);
            }
        }

        yield return(0);

        yield return(0);

        foreach (StageDataEnemy stageDataEnemy in stageData.Enemies)
        {
            EnemyBase prefab = null;
            switch (stageDataEnemy.Type)
            {
            case StageDataEnemy.DataType.Grounder:
                prefab = _prefabEnemyGrounders [stageDataEnemy.Level];
                break;

            case StageDataEnemy.DataType.Floater:
                prefab = _prefabEnemyFloters [stageDataEnemy.Level];
                break;

            case StageDataEnemy.DataType.Liner:
                prefab = _prefabEnemyLiners [stageDataEnemy.Level];
                break;
            }
            if (prefab != null)
            {
                EnemyBase enemy = Instantiate <EnemyBase> (prefab);
                enemy.transform.localPosition = stageDataEnemy.Pos;
                enemy.transform.SetParent(_gameUnitWorld.transform, false);
            }
        }

        _stageData   = stageData;
        _initialized = true;
    }
コード例 #2
0
    public void InitializeForExAtkCollider(StageObject attacker, Transform parent, AttackInfo atkInfo, Vector3 pos, Vector3 rot, float radius, float height, int attackLayer)
    {
        //IL_0001: Unknown result type (might be due to invalid IL or missing references)
        //IL_001c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0021: Expected O, but got Unknown
        //IL_002a: Unknown result type (might be due to invalid IL or missing references)
        //IL_0032: Unknown result type (might be due to invalid IL or missing references)
        //IL_003a: Unknown result type (might be due to invalid IL or missing references)
        //IL_008e: Unknown result type (might be due to invalid IL or missing references)
        this.get_gameObject().set_layer(attackLayer);
        m_attacker   = attacker;
        m_attackInfo = atkInfo;
        Transform val = this.get_transform();

        val.set_parent(parent);
        val.set_localEulerAngles(rot);
        val.set_localPosition(pos);
        val.set_localScale(Vector3.get_one());
        m_capsule.set_direction(2);
        m_capsule.set_radius(radius);
        m_capsule.set_height(height);
        m_capsule.set_enabled(true);
        m_capsule.set_center(new Vector3(0f, 0f, height * 0.5f));
        m_capsule.set_isTrigger(true);
        m_timeCount = 0f;
        if (MonoBehaviourSingleton <AttackColliderManager> .IsValid())
        {
            m_colliderProcessor = MonoBehaviourSingleton <AttackColliderManager> .I.CreateProcessor(m_attackInfo, attacker, m_capsule, this, Player.ATTACK_MODE.NONE, null);

            m_attackHitChecker = attacker.ReferenceAttackHitChecker();
        }
    }
コード例 #3
0
    public eNpcAllayState CanGoPray(StageObject client)
    {
        if (base.isDead)
        {
            return(eNpcAllayState.CANNOT);
        }
        if (!base.isNpc)
        {
            return(eNpcAllayState.CANNOT);
        }
        if (object.ReferenceEquals(base.controller, null) || object.ReferenceEquals(base.controller.brain, null) || object.ReferenceEquals(base.controller.brain.targetCtrl, null))
        {
            return(eNpcAllayState.CANNOT);
        }
        StageObject allyTarget = base.controller.brain.targetCtrl.GetAllyTarget();

        if (!object.ReferenceEquals(allyTarget, null))
        {
            if (allyTarget == client)
            {
                return(eNpcAllayState.SAME);
            }
            return(eNpcAllayState.ANOTHER);
        }
        return(eNpcAllayState.CAN);
    }
コード例 #4
0
 public virtual void OnDetachedObject(StageObject stage_object)
 {
     if (brain != null)
     {
         brain.HandleEvent(BRAIN_EVENT.DESTROY_OBJECT, stage_object);
     }
 }
コード例 #5
0
 public void Delete(bool is_get)
 {
     //IL_003c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0041: Unknown result type (might be due to invalid IL or missing references)
     //IL_0044: Unknown result type (might be due to invalid IL or missing references)
     //IL_004f: Unknown result type (might be due to invalid IL or missing references)
     //IL_014d: Unknown result type (might be due to invalid IL or missing references)
     if (!isDelete)
     {
         isDelete = true;
         isGet    = is_get;
         if (is_get)
         {
             targetObject = MonoBehaviourSingleton <StageObjectManager> .I.self;
             Bounds bounds = targetObject._collider.get_bounds();
             distance = Vector3.Distance(bounds.get_center(), _transform.get_position());
             distanceAnim.Set(parameter.getAnimTime, 0f, 1f, parameter.distanceAnim, 0f, null);
             distanceAnim.Play();
             speedAnim.Set(parameter.getAnimTime, 0f, parameter.rotateSpeed, parameter.rotateSpeedAnim, 0f, null);
             speedAnim.Play();
             scaleAnim.Set(parameter.getAnimTime, 0f, 1f, parameter.scaleAnim, 0f, null);
             scaleAnim.Play();
             moveTime      = 0f;
             animationStep = AnimationStep.OPEN;
             announceInfo  = MonoBehaviourSingleton <InGameManager> .I.CreateDropAnnounceInfoList(deliveryInfo, itemInfo, true);
         }
         else
         {
             this.get_gameObject().SetActive(false);
         }
     }
 }
コード例 #6
0
    //-----------------------------------------------------
    //  ObjectがFastenerの開いている場所かどうか
    //-----------------------------------------------------
    bool ObjectValue(StageObject obj)
    {
        const float SLIDER_HALF_SIZE = 0.45f;

        //位置
        Vector2 objPos     = obj.transform.position;
        Vector2 matchPoint = GetMatchPoint(refarencePoint.position, endPoint.position, objPos);

        Vector2 startPos = new Vector2(refarencePoint.position.x + SLIDER_HALF_SIZE, refarencePoint.position.y);
        Vector2 endPos   = new Vector2(endPoint.position.x - SLIDER_HALF_SIZE, endPoint.position.y);

        //敵と点の距離
        float enemyToStartDif = (matchPoint - startPos).magnitude - obj.GetRadius();
        float enemyToEndDif   = (matchPoint - endPos).magnitude - obj.GetRadius();

        //割合
        enemyToStartDif = enemyToStartDif / sliderRange;
        enemyToEndDif   = enemyToEndDif / sliderRange;

        //開いているところでない
        if (moveValueArr[0] >= enemyToStartDif)
        {
            return(false);
        }
        if (moveValueArr[1] >= enemyToEndDif)
        {
            return(false);
        }

        return(true);
    }
コード例 #7
0
    public static NonPlayer GetNearestAliveNpc(StageObject client)
    {
        NonPlayer result = null;
        float     num    = 3.40282347E+38f;
        int       i      = 0;

        for (int count = MonoBehaviourSingleton <StageObjectManager> .I.playerList.Count; i < count; i++)
        {
            NonPlayer nonPlayer = MonoBehaviourSingleton <StageObjectManager> .I.playerList[i] as NonPlayer;
            if (!object.ReferenceEquals(nonPlayer, null) && !(nonPlayer == client))
            {
                switch (nonPlayer.CanGoPray(client))
                {
                case NonPlayer.eNpcAllayState.SAME:
                    return(nonPlayer);

                case NonPlayer.eNpcAllayState.CAN:
                {
                    float lengthWithBetweenObject = GetLengthWithBetweenObject(client, nonPlayer);
                    if (lengthWithBetweenObject < num)
                    {
                        result = nonPlayer;
                        num    = lengthWithBetweenObject;
                    }
                    break;
                }
                }
            }
        }
        return(result);
    }
コード例 #8
0
        private static void CreateStage_Object(StageObject obj, string location, bool force = false)
        {
            SpawnPoint spawn = new SpawnPoint(float.Parse(Xml.Root.XPathSelectElement(Root + location + "/h").Value, CultureInfo.InvariantCulture),
                                              float.Parse(Xml.Root.XPathSelectElement(Root + location + "/x").Value, CultureInfo.InvariantCulture),
                                              float.Parse(Xml.Root.XPathSelectElement(Root + location + "/y").Value, CultureInfo.InvariantCulture),
                                              Zvalue);

            if (MathHelper.GetRandomInteger(2) == 1 || force)
            {
                string model = (string)PedList[Rand.RandomNumber(1, PedList.Count)];

                obj.Ped = new Ped(model, spawn.Position, spawn.Heading);
                obj.Ped.RandomizeVariation();
                obj.Ped.MakeMissionPed();
                obj.Exists = true;

                if (!force)
                {
                    AmbientList.Add(spawn, true);
                    "Ped added to ambient list".AddLog();
                }

                ("Stage_Object at location " + location + " created successfully").AddLog();
            }
            else
            {
                obj.Exists = false;
                AmbientList.Add(spawn, false);
                ("Stage_Object " + Number + " skipped").AddLog();
            }
            Number++;
        }
コード例 #9
0
 protected override void Update()
 {
     //IL_0089: Unknown result type (might be due to invalid IL or missing references)
     //IL_008e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0093: Unknown result type (might be due to invalid IL or missing references)
     //IL_009a: Unknown result type (might be due to invalid IL or missing references)
     //IL_009f: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
     base.Update();
     if (enemy.isHiding && (enemy.IsOriginal() || enemy.IsCoopNone()))
     {
         if ((double)turnUpTimer >= 0.5)
         {
             if (base.brain.opponentMem != null)
             {
                 base.brain.opponentMem.Update();
             }
             StageObject targetObjectOfNearest = base.brain.targetCtrl.GetTargetObjectOfNearest();
             if (targetObjectOfNearest != null)
             {
                 Vector2 val  = targetObjectOfNearest._position.ToVector2XZ();
                 Vector2 val2 = enemy._position.ToVector2XZ();
                 float   num  = Vector2.Distance(val, val2);
                 if (num <= enemy.turnUpDistance)
                 {
                     enemy.TurnUp();
                 }
             }
             turnUpTimer = 0f;
         }
         turnUpTimer += Time.get_deltaTime();
     }
 }
コード例 #10
0
 public virtual void OnDetachedObject(StageObject stage_object)
 {
     if (stageObject == stage_object)
     {
         stageObject = null;
     }
 }
コード例 #11
0
    public void ClearTarget(AttackInfo info, StageObject target)
    {
        List <HitRecord> list = attackHitList.Get(info.name);

        if (!object.ReferenceEquals(list, null))
        {
            int       num   = 0;
            int       count = list.Count;
            HitRecord hitRecord;
            while (true)
            {
                if (num >= count)
                {
                    return;
                }
                hitRecord = list[num];
                if (hitRecord.target == target)
                {
                    break;
                }
                num++;
            }
            list.Remove(hitRecord);
        }
    }
コード例 #12
0
 private void SetNearWaveMatchTarget()
 {
     //IL_0049: Unknown result type (might be due to invalid IL or missing references)
     //IL_0054: Unknown result type (might be due to invalid IL or missing references)
     //IL_0059: Unknown result type (might be due to invalid IL or missing references)
     //IL_005e: Unknown result type (might be due to invalid IL or missing references)
     if (base.fsm != null && base.targetCtrl != null)
     {
         StageObject stageObject = null;
         float       num         = 3.40282347E+38f;
         for (int i = 0; i < MonoBehaviourSingleton <StageObjectManager> .I.waveTargetList.Count; i++)
         {
             StageObject stageObject2 = MonoBehaviourSingleton <StageObjectManager> .I.waveTargetList[i];
             if (!(stageObject2 == null))
             {
                 Vector3 val          = stageObject2._position - enemy._position;
                 float   sqrMagnitude = val.get_sqrMagnitude();
                 if (sqrMagnitude < num)
                 {
                     num         = sqrMagnitude;
                     stageObject = stageObject2;
                 }
             }
         }
         if (!(stageObject == null))
         {
             base.fsm.ChangeState(STATE_TYPE.SELECT);
             base.targetCtrl.SetCurrentTarget(stageObject);
             HandleEvent(BRAIN_EVENT.WAVE_TARGET, stageObject);
         }
     }
 }
コード例 #13
0
    private StageObject SpawnStageObject(StageObject obj, int laneIndex, float xPos, int dir = 0, bool clampPos = true)
    {
        obj.Init(dir, laneIndex);

        float left  = leftSide.position.x;
        float right = rightSide.position.x;

        Transform lane = lanes[laneIndex];

        obj.transform.position = new Vector2(xPos, lane.position.y);

        if (clampPos)
        {
            if (obj.leftEdge < left)
            {
                obj.transform.position = new Vector2(left + (obj.centerX - obj.leftEdge), obj.centerY);
            }
            else if (obj.rightEdge > right)
            {
                obj.transform.position = new Vector2(right - (obj.rightEdge - obj.centerX), obj.centerY);
            }
        }

        return(obj);
    }
コード例 #14
0
    public bool CheckHitAttack(AttackHitInfo info, Collider to_collider, StageObject to_object)
    {
        List <HitRecord> list = attackHitList.Get(info.name);

        if (list != null)
        {
            int i = 0;
            for (int count = list.Count; i < count; i++)
            {
                HitRecord hitRecord = list[i];
                if (hitRecord.target == to_object)
                {
                    if (info.enableIdentityCheck)
                    {
                        return(false);
                    }
                    if (Time.get_time() - hitRecord.lastHitTime <= info.hitIntervalTime)
                    {
                        return(false);
                    }
                }
            }
        }
        return(true);
    }
コード例 #15
0
    public void Initialize(int playerId, int decoyId, BulletData bullet, Vector3 position, SkillInfo.SkillParam skill, bool isHit)
    {
        //IL_0085: Unknown result type (might be due to invalid IL or missing references)
        //IL_008a: Expected O, but got Unknown
        //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
        //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
        //IL_010c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0111: Unknown result type (might be due to invalid IL or missing references)
        //IL_012c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0131: Unknown result type (might be due to invalid IL or missing references)
        //IL_0143: Unknown result type (might be due to invalid IL or missing references)
        //IL_015f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0197: Unknown result type (might be due to invalid IL or missing references)
        if (!MonoBehaviourSingleton <StageObjectManager> .IsValid())
        {
            Log.Error(LOG.INGAME, "StageObjectManager is invalid. Can't initialize DecoyBulletObject.");
        }
        else
        {
            base.objectType = OBJECT_TYPE.DECOY;
            StageObject stageObject = MonoBehaviourSingleton <StageObjectManager> .I.FindPlayer(playerId);

            if (!object.ReferenceEquals(stageObject, null))
            {
                ownerPlayer = (stageObject as Player);
            }
            bulletData      = bullet;
            skillParam      = skill;
            lifeTime        = bulletData.data.appearTime;
            dontHitSec      = bulletData.dataDecoy.dontHitSec;
            cachedTransform = this.get_transform();
            cachedTransform.SetParent(MonoBehaviourSingleton <StageObjectManager> .I._transform);
            cachedTransform.set_position(position);
            cachedTransform.set_localScale(Vector3.get_one());
            if (MonoBehaviourSingleton <EffectManager> .IsValid())
            {
                cachedEffectTransform = EffectManager.GetEffect(bulletData.data.effectName, MonoBehaviourSingleton <EffectManager> .I._transform);
                cachedEffectTransform.set_position(cachedTransform.get_position() + bulletData.data.dispOffset);
                cachedEffectTransform.set_localRotation(Quaternion.Euler(bulletData.data.dispRotation));
            }
            id = decoyId;
            this.get_gameObject().set_name(OBJ_NAME + decoyId);
            this.get_gameObject().set_layer(12);
            ignoreLayerMask |= -1073741824;
            if (!object.ReferenceEquals(ownerPlayer, null) && isHit)
            {
                cachedCollider = this.get_gameObject().AddComponent <SphereCollider>();
                cachedCollider.set_radius(bulletData.data.radius);
                cachedCollider.set_isTrigger(true);
                cachedCollider.set_enabled(true);
                if (!string.IsNullOrEmpty(skillParam.tableData.attackInfoNames[0]))
                {
                    atkInfo = FindAttackInfo(skillParam.tableData.attackInfoNames[0], true, false);
                }
                ownerPlayer.GetAtk(atkInfo as AttackHitInfo, ref exAtk);
            }
            isInitialized = true;
        }
    }
コード例 #16
0
 private void OnTriggerEnter(Collider collider)
 {
     //IL_0036: Unknown result type (might be due to invalid IL or missing references)
     //IL_003c: Unknown result type (might be due to invalid IL or missing references)
     //IL_004f: Unknown result type (might be due to invalid IL or missing references)
     //IL_007f: Unknown result type (might be due to invalid IL or missing references)
     if (!(_collider == null) && _collider.get_enabled() && !(this.stageObject == null) && !(collider.get_gameObject() == this.get_gameObject()))
     {
         StageObject  stageObject = null;
         BulletObject component   = collider.get_gameObject().GetComponent <BulletObject>();
         if (component != null)
         {
             stageObject = component.stageObject;
         }
         else
         {
             if (collider.get_isTrigger())
             {
                 return;
             }
             stageObject = collider.get_gameObject().GetComponentInParent <StageObject>();
         }
         if (!(stageObject == null) && !(stageObject == this.stageObject))
         {
             Add(stageObject, collider, component);
         }
     }
 }
コード例 #17
0
	private void OnTriggerEnter(Collider collider)
	{
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		if (!(brain == null) && !(_collider == null) && _collider.get_enabled() && collider.get_isTrigger() && !(collider.get_gameObject() == this.get_gameObject()))
		{
			StageObject stageObject = null;
			BulletObject component = collider.get_gameObject().GetComponent<BulletObject>();
			stageObject = ((!(component != null)) ? collider.get_gameObject().GetComponentInParent<StageObject>() : component.stageObject);
			if (!(stageObject == null) && !(stageObject == brain.owner))
			{
				ColliderRecord colliderRecord = RecordCollider(collider, stageObject, component);
				if (colliderRecord.isMove)
				{
					brain.HandleEvent(BRAIN_EVENT.BULLET_CATCH, component);
				}
				else
				{
					brain.HandleEvent(BRAIN_EVENT.COLLIDER_CATCH, stageObject);
				}
			}
		}
	}
コード例 #18
0
    public static void DestroyAllNonPlayer()
    {
        if (MonoBehaviourSingleton <StageObjectManager> .IsValid())
        {
            List <StageObject>   destroyList = new List <StageObject>();
            Action <StageObject> action      = delegate(StageObject o)
            {
                if (o is NonPlayer && !o.isDestroyWaitFlag && (o.IsCoopNone() || o.IsOriginal()))
                {
                    destroyList.Add(o);
                }
            };
            MonoBehaviourSingleton <StageObjectManager> .I.cacheList.ForEach(action);

            MonoBehaviourSingleton <StageObjectManager> .I.nonplayerList.ForEach(action);

            Action <StageObject> action2 = delegate(StageObject o)
            {
                Player player = o as Player;
                if (player != null && player.isNpc)
                {
                    destroyList.Add(o);
                }
            };
            MonoBehaviourSingleton <StageObjectManager> .I.playerList.ForEach(action2);

            for (int i = 0; i < destroyList.Count; i++)
            {
                StageObject stageObject = destroyList[i];
                stageObject.DestroyObject();
            }
        }
    }
コード例 #19
0
 public static void TransfarOwnerForClientObjects(int client_id, int owner_client_id)
 {
     //IL_003f: Unknown result type (might be due to invalid IL or missing references)
     if (MonoBehaviourSingleton <StageObjectManager> .IsValid())
     {
         if (!FieldManager.IsValidInGameNoQuest())
         {
             int num = 0;
             while (num < MonoBehaviourSingleton <StageObjectManager> .I.cacheList.Count)
             {
                 Player player = MonoBehaviourSingleton <StageObjectManager> .I.cacheList[num] as Player;
                 if (player != null)
                 {
                     player.get_gameObject().SetActive(true);
                     MonoBehaviourSingleton <StageObjectManager> .I.cacheList.RemoveAt(num);
                 }
                 else
                 {
                     num++;
                 }
             }
         }
         bool flag = MonoBehaviourSingleton <CoopManager> .I.coopMyClient.clientId == client_id;
         int  i    = 0;
         for (int count = MonoBehaviourSingleton <StageObjectManager> .I.objectList.Count; i < count; i++)
         {
             StageObject stageObject = MonoBehaviourSingleton <StageObjectManager> .I.objectList[i];
             if ((stageObject.coopClientId == client_id || (stageObject.coopClientId == 0 && flag)) && (!FieldManager.IsValidInGame() || !(stageObject is Enemy)) && (!FieldManager.IsValidInGameNoQuest() || !(stageObject is Player)))
             {
                 TransfarOwner(stageObject, owner_client_id);
             }
         }
     }
 }
コード例 #20
0
    public static Enemy GetNearestAliveEnemy(StageObject baseObj)
    {
        Enemy result = null;

        if (!MonoBehaviourSingleton <StageObjectManager> .IsValid())
        {
            return(null);
        }
        StageObjectManager i = MonoBehaviourSingleton <StageObjectManager> .I;

        if (i.enemyList == null || i.enemyList.Count <= 0)
        {
            return(null);
        }
        float num = 3.40282347E+38f;

        foreach (StageObject enemy2 in i.enemyList)
        {
            Enemy enemy = enemy2 as Enemy;
            if (!(enemy == null) && !enemy.isDead)
            {
                float lengthWithBetweenObject = GetLengthWithBetweenObject(baseObj, enemy);
                if (lengthWithBetweenObject < num)
                {
                    result = enemy;
                    num    = lengthWithBetweenObject;
                }
            }
        }
        return(result);
    }
コード例 #21
0
    private StageObject Find(List <StageObject> list, Vector3 pos, float range)
    {
        //IL_001d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0033: Unknown result type (might be due to invalid IL or missing references)
        //IL_0038: Unknown result type (might be due to invalid IL or missing references)
        //IL_0039: Unknown result type (might be due to invalid IL or missing references)
        //IL_003e: Unknown result type (might be due to invalid IL or missing references)
        StageObject result = null;
        float       num    = range;
        int         i      = 0;

        for (int count = list.Count; i < count; i++)
        {
            StageObject stageObject = list[i];
            if (stageObject.get_gameObject().get_activeSelf())
            {
                Vector3 val       = stageObject._transform.get_position() - pos;
                float   magnitude = val.get_magnitude();
                if (magnitude < num)
                {
                    num    = magnitude;
                    result = stageObject;
                }
            }
        }
        return(result);
    }
コード例 #22
0
    void OnTriggerEnter(Collider col)
    {
        string tag = col.gameObject.tag;

        switch (sensorType)
        {
        case SensorType.BulletDestroy:
            if (tag == "bullet" || tag == "enemybullet")
            {
                Destroy(col.gameObject);
            }
            break;

        case SensorType.StageObjDestroy:
            if (tag == "enemy" || tag == "item")
            {
                Destroy(col.gameObject);
            }
            break;

        case SensorType.FrontSensor:
            if (tag == "enemy" || tag == "item")
            {
                StageObject em = col.GetComponent <StageObject>();
                col.gameObject.transform.parent = transform.root;
                if (em != null)
                {
                    em.isActive = true;
                }
            }
            break;
        }
    }
コード例 #23
0
 private void Destroy()
 {
     //IL_0043: Unknown result type (might be due to invalid IL or missing references)
     //IL_0054: Unknown result type (might be due to invalid IL or missing references)
     //IL_0096: Unknown result type (might be due to invalid IL or missing references)
     if (!IsDeleted)
     {
         m_isDeleted = true;
         if (!string.IsNullOrEmpty(m_landHitEffectName))
         {
             Transform effect = EffectManager.GetEffect(m_landHitEffectName, null);
             if (effect != null)
             {
                 effect.set_position(m_cachedTransform.get_position());
                 effect.set_rotation(m_cachedTransform.get_rotation());
             }
         }
         if (m_attacker != null)
         {
             Enemy enemy = m_attacker as Enemy;
             if (enemy != null)
             {
                 enemy.OnDestroyFunnel(this);
             }
             m_attacker = null;
         }
         Object.Destroy(this.get_gameObject());
     }
 }
コード例 #24
0
 public virtual void OnDetachedObject(StageObject stage_object)
 {
     if (stage_object is Enemy && (stage_object as Enemy).colliders == ignoreColliders)
     {
         ResetIgnoreColliders();
     }
 }
コード例 #25
0
    public override void OnTriggerExit(Collider to_collider)
    {
        //IL_0008: Unknown result type (might be due to invalid IL or missing references)
        base.OnTriggerExit(to_collider);
        StageObject componentInParent = to_collider.get_gameObject().GetComponentInParent <StageObject>();

        if (!(componentInParent == null))
        {
            int num   = 0;
            int count = enterList.Count;
            while (true)
            {
                if (num >= count)
                {
                    return;
                }
                if (enterList[num] == componentInParent)
                {
                    break;
                }
                num++;
            }
            componentInParent.OnContinuationExit(attackContinuationInfo, base.fromCollider);
            enterList.RemoveAt(num);
        }
    }
コード例 #26
0
    public void SetCurrentTarget(StageObject target_obj)
    {
        StageObject currentTarget = GetCurrentTarget();

        brain.owner.SetActionTarget(target_obj, true);
        brain.opponentMem.OnTargetOpponent(target_obj, currentTarget);
    }
コード例 #27
0
    public void UpdateHeightTEST() //this is the old one, with obly 1 cube selector
    {
        currentHeight = Mathf.Clamp(currentHeight, 0, StageBuilder.MAX_HEIGHT);

        float      newHei           = transform.position.y;
        Vector3    fromTopPosition  = new Vector3(transform.position.x, StageBuilder.MAX_HEIGHT, transform.position.z);
        Vector3    toBottomPosition = new Vector3(transform.position.x, 0, transform.position.z);
        Vector3    direction        = toBottomPosition - fromTopPosition;
        RaycastHit hit;

        if (Physics.Raycast(fromTopPosition, direction, out hit))
        {
            if (hit.transform.gameObject.GetComponent <StageObject>() != null)
            {
                //height will be the highest block in that tile plus that block's height, same if it's an object
                StageObject obt = hit.transform.gameObject.GetComponent <StageObject>();
                newHei = obt.GridPosition.Height + obt.GetCurrentItemHeight();
            }
            else if (hit.transform.gameObject.GetComponent <StageBlock>() != null)
            {
                StageBlock block = hit.transform.gameObject.GetComponent <StageBlock>();
                newHei = block.GridPosition.Height + block.GetCurrengBlockHeight();
            }
            else
            {
                newHei = 0;
            }
        }

        currentHeight      = newHei;
        transform.position = new Vector3(transform.position.x, currentHeight, transform.position.z);
    }
コード例 #28
0
    protected float EvaluateDangerWithTargetPlace(Brain brain, StageObject target)
    {
        float val = 1f;

        OpponentMemory.OpponentRecord opponentRecord = brain.opponentMem.Find(target);
        if (opponentRecord != null)
        {
            switch (opponentRecord.record.placeOfOpponent)
            {
            case PLACE.BACK:
                val = 10f;
                break;

            case PLACE.FRONT:
                val = 90f;
                break;

            case PLACE.RIGHT:
            case PLACE.LEFT:
                val = 50f;
                break;
            }
        }
        return(EvaluateValue(val, 1f, 100f));
    }
コード例 #29
0
ファイル: StageMap.cs プロジェクト: fm64hylian/Some-Tools
    public void Clean()
    {
        if (groundBlocks.Count > 0)
        {
            for (int i = groundBlocks.Count - 1; i >= 0; i--)
            {
                StageBlock item = groundBlocks[i];
                groundBlocks.Remove(item);
                item.DeleteItem();
            }
        }
        //objects
        if (StageObjects.Count > 0)
        {
            for (int i = StageObjects.Count - 1; i >= 0; i--)
            {
                StageObject item = StageObjects[i];
                StageObjects.Remove(item);
                item.DeleteItem();
            }
        }
        //for (int i = Decorations.Count - 1; i >= 0; i--)
        //{
        //    StageDecoration item = Decorations[i];
        //    Decorations.Remove(item);
        //    item.DeleteItem();
        //}

        PlayerSpawns.Clear();
        EnemySpawns.Clear();
    }
コード例 #30
0
 public virtual void HandleEvent(BRAIN_EVENT ev, object param = null)
 {
     if (ev == BRAIN_EVENT.DESTROY_OBJECT)
     {
         StageObject stageObject = (StageObject)param;
         if (opponentMem != null)
         {
             opponentMem.Remove(stageObject);
         }
         if (targetCtrl != null && targetCtrl.GetCurrentTarget() == stageObject)
         {
             targetCtrl.MissCurrentTarget();
         }
         if (targetCtrl != null && targetCtrl.GetAllyTarget() == stageObject)
         {
             targetCtrl.SetAllyTarget(null);
         }
         if (targetUpdateSpanTimer != null)
         {
             targetUpdateSpanTimer.SetTempSpan(0.5f);
         }
     }
     if (fsm != null)
     {
         fsm.HandleEvent(ev, param);
     }
     if (think != null)
     {
         think.HandleEvent(this, ev, param);
     }
 }
コード例 #31
0
ファイル: Field.cs プロジェクト: pb0/ID0_Test
    void AddObstacle(Layer layer, float posX, int stageObjectId, FSM parentFsm)
    {
        FieldObject instance = null;
        FieldObjectEntity objectField = TableLoader.GetTable<FieldObjectEntity>().Get(stageObjectId);
        StageObjectEntity2 objectStage = TableLoader.GetTable<StageObjectEntity2>().Get(stageObjectId);

        if (objectStage.stageObjectType == StageObjectType.Monster)
        {
            instance = new Monster(objectField, objectStage, parentFsm);
        }
        else
        {
            instance = new StageObject(objectField, objectStage, parentFsm);
        }

        layer.AddSubject(instance, posX, 0);
        AddFieldInstance(instance);
    }
コード例 #32
0
ファイル: Field.cs プロジェクト: pb0/ID0_Test
    void AddObstacle(Layer layer, float posX, int stageObjectId, ItemDropManager itemDropManager, FSM parentFsm, bool lastMonster)
    {
        FieldInstance instance = null;
        ObjectField objectField = TableLoader.GetTable<ObjectField>().Get(stageObjectId);
        ObjectStage objectStage = TableLoader.GetTable<ObjectStage>().Get(stageObjectId);

        if (objectStage.Type == E_StageObjectType.Monster)
        {
            ObjectMonster objectMonster = TableLoader.GetTable<ObjectMonster>().Get(objectStage.ObjectID);
            if (objectMonster.MonsterType == E_MonsterType.Boss)
            {
                BossAlertTrigger alertTrigger = new BossAlertTrigger(parentFsm);
                layer.AddSubject(alertTrigger, posX - Constants.Instance.Field.CameraWidth, 0);
                AddFieldInstance(alertTrigger);

                instance = new BossMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else if (lastMonster)
            {
                instance = new LastMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else
            {
                instance = new BattleObstacle(objectField, objectStage, itemDropManager, parentFsm);
            }
        }
        else if (objectStage.Type == E_StageObjectType.Chest)
        {
            instance = new Chest(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.EndPoint)
        {
            instance = new StageEndDoor(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Trap)
        {
            instance = new Trap(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Etc)
        {
            instance = new StageObject(objectField, objectStage, itemDropManager, parentFsm);
        }
        else
        {
            Assert.Fail("not implemented");
        }

        layer.AddSubject(instance, posX, 0);
        AddFieldInstance(instance);
    }