//Vector3 direction;
    //float angle;
    //int angleCorrection = 90;

    // Use this for initialization
    void Start()
    {
        base.Load();

        // Cache transform to later check for cast range
        playerTransform = LocalPlayerReferences.playerTransform;

        string layerName = LayerMask.LayerToName(LocalPlayerReferences.playerGameObject.layer);

        layerName = layerName.Replace("Player", "Ability");

        projectileName = spawnedObject.name.Replace("(Clone)", "");

        // Load castRange based on projectile name
        string abilityBaseName = projectileName.Replace("Projectile", "");

        Debug.Log("SpawnAbility Start name for cast range config is " + abilityBaseName);
        castRange = AbilityDataCache.GetAbilityCastRange(abilityBaseName);

        // If it's an ice wall or a mana sphere leave the layer to be the default one so that all players can interact with it
        if (name.Contains("IceWall") || name.Contains("Mana"))
        {
            return;
        }

        if (isBuffForTeam)
        {
            layerName = Utils.Instance.SwitchPlayerLayerName(layerName);
        }

        projectileLayer = LayerMask.NameToLayer(layerName);
    }
    private void Start()
    {
        playerTransform = LocalPlayerReferences.playerTransform;
        teleportation   = LocalPlayerReferences.player.teleportation;

        // Load cast range from config
        castRange = AbilityDataCache.GetAbilityCastRange("Blink");
    }
Exemple #3
0
    private void Start()
    {
        Debug.Log("SpellIndicator for player " + playerID);

        playerTransform = LocalPlayerReferences.playerTransform;
        spriteRenderer  = GetComponent <SpriteRenderer>();

        Debug.Log("SpellIndicator before name is " + name);
        string spName = name.Replace("SpellIndicator(Clone)", "");

        Debug.Log("SpellIndicator after name is " + spName);

        castRange = AbilityDataCache.GetAbilityCastRange(spName);
        Debug.Log("SpellIndicator castRange is " + castRange);

        alphaInCastRange    = alphaInCastRange / 10;
        alphaOutOfCastRange = alphaOutOfCastRange / 10;

        inRangeSprite    = spriteRenderer.sprite;
        outOfRangeSprite = AbilityDataCache.GetSpellIndicatorOutOfRangeSprite();

        inRangeScale          = spriteRenderer.transform.localScale;
        outOfRangeSpriteScale = new Vector3(0.36f, 0.36f, 1);
    }