示例#1
0
        public void Start()
        {
            this.m_proj                 = base.GetComponent <Projectile>();
            this.m_owner                = this.m_proj.Owner as PlayerController;
            this.m_identifier           = (EtGProjectileIdentifier)UnityEngine.Random.Range(1, 114);
            this.m_data                 = EtGProjectileData.GetDataForIdentifier(this.m_identifier);
            this.m_proj.sprite.spriteId = this.m_proj.sprite.GetSpriteIdByName(this.m_data.spriteName);
            PixelCollider pixelCollider = this.m_proj.specRigidbody.PrimaryPixelCollider;

            this.m_proj.baseData.speed  = 0;
            pixelCollider.ManualOffsetX = 0;
            pixelCollider.ManualOffsetY = 0;
            pixelCollider.ManualWidth   = this.m_data.dimensions.x;
            pixelCollider.ManualHeight  = this.m_data.dimensions.y;
            pixelCollider.Regenerate(this.m_proj.transform, true, true);
            this.m_proj.specRigidbody.PixelColliders = new List <PixelCollider>
            {
                pixelCollider
            };
            if (!this.m_data.canRotate)
            {
                this.m_proj.shouldRotate       = false;
                this.m_proj.transform.rotation = Quaternion.Euler(0, 0, 0);
            }
        }
示例#2
0
            public static EtGProjectileData GetDataForIdentifier(EtGProjectileIdentifier identifier)
            {
                EtGProjectileData data = new EtGProjectileData();

                data.spriteName     = identifier.ToString();
                data.canRotate      = true;
                data.canChangeSides = false;
                if (identifier == EtGProjectileIdentifier.Blobuloid || identifier == EtGProjectileIdentifier.Blobulin || identifier == EtGProjectileIdentifier.Bloodbulon || identifier == EtGProjectileIdentifier.Coaler ||
                    identifier == EtGProjectileIdentifier.Flesh_Cube || identifier == EtGProjectileIdentifier.Gunreaper || identifier == EtGProjectileIdentifier.Knight_Ad ||
                    identifier == EtGProjectileIdentifier.Lead_Cube || identifier == EtGProjectileIdentifier.Lord_of_the_Jammed || identifier == EtGProjectileIdentifier.Blizzbulon || identifier == EtGProjectileIdentifier.Beadie ||
                    identifier == EtGProjectileIdentifier.Cubulead || identifier == EtGProjectileIdentifier.Cubulead || identifier == EtGProjectileIdentifier.Blue_Bookllet || identifier == EtGProjectileIdentifier.Green_Bookllet ||
                    identifier == EtGProjectileIdentifier.Bookllet || identifier == EtGProjectileIdentifier.Leadbulon || identifier == EtGProjectileIdentifier.Mountain_Cube || identifier == EtGProjectileIdentifier.Tarnisher)
                {
                    data.canRotate = false;
                }
                if (identifier == EtGProjectileIdentifier.Dead_Blow || identifier == EtGProjectileIdentifier.Knight_Ad || identifier == EtGProjectileIdentifier.Misfire_Beast)
                {
                    data.canChangeSides = true;
                }
                data.dimensions         = EtGProjectileData.ReadyDimensionDictionary()[identifier];
                data.betrayalEnemyGuids = EtGProjectileData.ReadyGuidDictionary()[identifier];
                return(data);
            }