示例#1
0
    public void Awake()
    {
        if (AS_SniperKit.Environment != null)
        {
            WindSpeed = AS_SniperKit.Environment.WindSpeed;
        }

        rigidBodyComp   = GetComponent <Rigidbody>();
        targetLocked    = null;
        initialPosition = this.gameObject.transform.position;
        AS_ActionCamera actioncam = (AS_ActionCamera)GameObject.FindObjectOfType(typeof(AS_ActionCamera));

        if (actioncam != null)
        {
            actionPreset = actioncam.GetPresets();
            if (actionPreset != null)
            {
                actionPreset.Shoot(this.gameObject);
            }
        }
        if (this.GetComponent <Renderer>())
        {
            this.GetComponent <Renderer>().enabled = true;
        }
    }
示例#2
0
    public void Awake()
    {
        targetLocked = null;
        initialPosition = this.gameObject.transform.position;
        AS_ActionCamera actioncam = (AS_ActionCamera)GameObject.FindObjectOfType (typeof(AS_ActionCamera));

        if (actioncam != null) {
            actionPreset = actioncam.GetPresets ();
            if (actionPreset != null) {
                actionPreset.Shoot (this.gameObject);
            }
        }
        if(this.GetComponent<Renderer>())
            this.GetComponent<Renderer>().enabled = true;
    }
示例#3
0
    public void Awake()
    {
        initialPosition = this.gameObject.transform.position;
        AS_ActionCamera actioncam = (AS_ActionCamera)GameObject.FindObjectOfType(typeof(AS_ActionCamera));

        if (actioncam != null)
        {
            actionPreset = actioncam.GetPresets();
            if (actionPreset != null)
            {
                actionPreset.Shoot(this.gameObject);
            }
        }
        this.GetComponent <Renderer>().enabled = true;
    }
示例#4
0
    public void Awake()
    {
        if (AS_SniperKit.Environment != null)
        {
            WindSpeed = AS_SniperKit.Environment.WindSpeed;
        }

        if (AS_SniperKit.ActionCam != null)
        {
            actionPreset = AS_SniperKit.ActionCam.GetPresets();
            if (actionPreset != null)
            {
                actionPreset.Shoot(this.gameObject);
            }
        }
    }
示例#5
0
    public AS_ActionPreset GetPresets()
    {
        if (ActionPresets.Length <= 0)
        {
            return(null);
        }
        AS_ActionPreset res = ActionPresets [UnityEngine.Random.Range(0, ActionPresets.Length)];

        if (!RandomIndex)
        {
            if (PresetIndex >= 0 && PresetIndex < ActionPresets.Length)
            {
                res = ActionPresets [PresetIndex];
            }
        }
        return(res);
    }